import logging
from redis import StrictRedis
class Config(object):
    """配置文件"""
    DEBUG=True
    SECRET_KEY ='e025409786f953f2a052e9e5943d5c50f49c08b2e2d4d1bd1fa27ac3'

    #mysql的配置
    SQLALCHEMY_DATABASE_URI='mysql://root:root@localhost:3306/information'
    SQLALCHEMY_TRACK_MODIFICATIONS=True

    #redis的配置
    REDIS_HOST='127.0.0.1'
    REDIS_PORT=6379

    #session的配置
    SESSION_TYPE='redis' #设置session的存储位置
    SESSION_USE_SIGNER=True
    SECRET_REDIS=StrictRedis(REDIS_HOST,REDIS_PORT)
    PERMANENT_SESSION_LIFETIME=24*60*60*2 #设置过期时间


class DevelopmentConfig(Config):
    """开发环境"""
    pass
    LOG_LEVEL=logging.DEBUG

class ProductionConfig(Config):
    """生产环境"""
    DEBUG = False
    LOG_LEVEL = logging.DEBUG

class TestConfig(Config):
    """测试环境"""
    pass
    LOG_LEVEL = logging.DEBUG

config={
    'development':DevelopmentConfig,
    'production':ProductionConfig,
    'test':TestConfig
}